package com.easy.controller;
import com.easy.bean.Tadmin;
import com.easy.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("admin")
//允许跨域
@CrossOrigin
public class AdminController {
    //依赖注入
    @Autowired
    AdminService adminService;
    @RequestMapping("list")
    public List<Tadmin> getList(){
        List<Tadmin> list=adminService.list();
        return  list;
    }
}
